home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 124
/
Tiger_Disk_124_20xx_Tiger-Crew-Disk_de_Side_B.d64
/
1.demo v2+
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
7KB
|
122 lines
0 rem **** basic v2+ demo 1 ****
1 rem ** by mark marzinzik **
2 rem **************************
3 dim xm(200),ym(200)
4 def fn x(x)=(x+1)/21*319
5 def fn y(y)=(10-y)/20*199
6 def fn y1(x)=11*exp(-.1*x)*sin(x)
9 rem ** netzgrafik
10 #colour,1,1,0
20 #hires,2
30 for x1=0 to 320 step 40
35 if x1=320 then x1=319
40 y1=(x1-160)^2/200
50 for x2=0 to 320 step 40:y2=199
55 if x2=320 then x2=319
60 #line,x1,y1,x2,y2
70 nextx2:nextx1
80 #text,0,0,"netz mit parabelfoermig angeordneten"
90 #text,1,0,"punkten (mit den befehlen #colour/"
100 #text,2,0,"#hires/#line)":gosub105:goto120
105 #text,4,1,"<taste>"
110 #keypress:#hires,2:return
120 rem ** roehrengrafik
130 for t=1 to 10 step 0.2
140 x=int(170+100*cos(t/2))
150 y=int(70+80*sin(t/3))
160 #rec,x-20,y-20,x+20,y+20
170 next t
171 #text,0,0,"roehrengrafik mit dem befehl #rec"
180 gosub 105
190 rem ** blueten-grafik
210 for i=50 to 100 step 5
220 for j=0 to 6.4 step 0.1
230 w=i+60*cos(7*j)
240 x=160+w*cos(j):y=100+w*sin(j)/1.5
250 if x>319 or x<0 or y>199 or y<0 then 280
260 if j<>0 then:#line,x1,y1,x,y
270 x1=x:y1=y:nextj:nexti
280 #text,0,0,"bluete erzeugt mit #line"
290 gosub449
300 rem ** balkendiagramm
301 #colour,1,1,0:#hires,2
310 data"1966","8.8","1970","15.0","1974","20.8","1978","25.4","1982","27.2"
311 data"1983","28.6","1984","29.1"
320 i=0:for x1=20 to 260 step 40:i=i+1
330 read j$(i),w$(i)
340 y2=170:x2=x1+20:y1=y2-2*val(w$(i))
350 #rec,x1,y1,x2,y2
360 a=x1+9:b=y1-9:c=x2+9:d=y2-9
370 #line,x1,y1,a,b:#line,a,b,a+20,b:#line,a+20,b,x1+20,y1:#line,x2,y2,c,d
380 #line,c,d,a+20,b
390 next
392 data16,2,15,8,13,12,12,17,12,22,11,27,11,33
400 for i=1 to 7:readz,s
410 #text,z,s,w$(i)
415 #text,22,6*(i-1),j$(i)
420 next
430 #text,7,8,"s u b v e n t i o n e n"
440 #text,8,8," des bundes in mrd dm"
445 #text,0,0,"balkendiagramm mit #rec/#line/#text"
446 gosub105:goto500
449 rem ** unterprogramm farben aendern
450 #text,1,1,"*** mit tasten 1/2/3 koennen die farben":r=1:h=1:z=0
457 #text,2,1," geaendert werden ***"
458 #text,24,0,"tippe <4> um weiterzumachen"
460 getx$:ifx$=""then460
461 ifx$="1"thenr=r+1:ifr=16thenr=0
470 ifx$="2"thenh=h+1:ifh=16thenh=0
480 ifx$="3"thenz=z+1:ifz=16thenz=0
485 ifx$="4"thenreturn
490 #colour,r,h,z
491 goto460
500 rem ** kreisdiagramm
510 data"ostblock","32","japan","38","westeuropa","103","usa","155"
511 data"sonstige","32"
520 #circle,162,100,50:c=0
525 #circle,162,100,15
530 for i=1 to 5
540 readl$(i),z$(i)
550 b=(val(z$(i))/360)*2*(NULL)
560 c=c+b
570 x=162+50*cos(c):x1=162+15*cos(c)
580 y=100+50*sin(c):y1=100+15*sin(c)
590 #line,x1,y1,x,y
600 next
610 #text,12,19,"360"
620 data11,23,15,22,15,17,9,17,13,23
630 fori=1to5
640 readz,s:#text,z,s,z$(i)
650 nexti
655 data10,27,18,24,16,4,5,16,13,27
660 for i=1to5:readz,s:#text,z,s,l$(i):nexti
670 #text,22,4,"installierte universal-computer"
680 #text,23,13,"1982 in mrd dm"
685 #text,24,12,"(insgesamt 360)"
690 #text,0,0,"kreisdiagramm mit #circle/#line/#text"
700 gosub105
710 rem ** kurvendarstellung
736 c=fnx(0):d=fny(0)
740 #line,fnx(0),fny(10),fnx(0),fny(-10)
750 #line,fnx(0),fny(0),fnx(20),fny(0)
760 i=0:for x=0 to 20 step0.1:i=i+1
761 a=fnx(x):b=fny(fny1(x))
770 #plot,1,a,b
775 xm(i)=a:ym(i)=b
780 next
790 #line,fnx(0),fny(0),xm(1),ym(1)
800 forj=1toi-1
810 #line,xm(j),ym(j),xm(j+1),ym(j+1)
820 next
830 #text,0,1,"10":#text,0,7,"gedaempfte schwingung mit"
840 #text,1,7,"#plot/#line/#text"
850 #text,24,0,"-10":#text,12,0," 0":#text,13,38,"20":#text,18,26,"<taste>"
860 #keypress:#hires,0:#margin,14:#screen,6:#pen,1:printchr$(147)
861 #place,10,14
870 print"alles klar!":print
880 #pen,14:print"ich hoffe,sie haben gefallen gefunden an";
890 print"basic v2+ ! sie sehen, es bietet unbe-"
900 print"grenzte moeglichkeiten in der grafikpro-";
910 print"grammierung."
920 end